#!/usr/local/bin/bash

while [ 1 ]; do

# cadmon
weekcadmony=`cadmonte "+%a"`

if [ $weekcadmony = "Sat" -o $weekcadmony = "Sun" ]; then
       rrdtool fetch /usr/local/rrd/rrd/channel1.rrd AVERAGE -s -14d | mono /usr/local/cadmon/cadmon.exe -c /usr/local/cadmon/cadmon.conf -o /usr/local/cadmon/channel1_cadmon_result #>> /var/log/channel1_result.log

#echo "weekend"
else
       rrdtool fetch /usr/local/rrd/rrd/channel1.rrd AVERAGE -s -7d |  mono /usr/local/cadmon/cadmon.exe  -c /usr/local/cadmon/cadmon.conf -o /usr/local/cadmon/channel1_cadmon_result #>> /var/log/channel1_result.log
fi

sleep 25
done